package edu.ccut.titan.tag.report.chart.dataset;

import java.util.HashMap;
import java.util.Map;
import edu.ccut.titan.tag.report.chart.IType;

public class TitanDatasetFactroy {
	private Map<String, ITitanDataset> datasets;

	public TitanDatasetFactroy() {
		datasets = new HashMap<String, ITitanDataset>();
		datasets.put(IType.DATASET_TYPE_CATEGORY,
				new TitanCategoryDataset());
		datasets
				.put(IType.DATASET_TYPE_PIE, new TitanPieDataset());
		datasets.put(IType.DATASET_TYPE_XY, new TitanXYDataset());
		datasets
				.put(IType.DATASET_TYPE_XYZ, new TitanXYZDataset());
		datasets.put(IType.DATASET_TYPE_TIMESERIES,
				new TitanTimeSeriesDataset());
		datasets.put(IType.DATASET_TYPE_TIMEPERIOD,
				new TitanTimePeriodDataset());
		datasets.put(IType.DATASET_TYPE_VALUE,
				new TitanValueDataset());
		datasets.put(IType.DATASET_TYPE_HIGHLOW,
				new TitanHighLowDataset());
	}

	public ITitanDataset getDataset(String type) {
		return datasets.get(type);
	}
}
